package com.example.mobile2021606128wje0427;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import java.util.List;

public class tingchechangAdapter extends RecyclerView.Adapter<tingchechangAdapter.ViewHolder> {
    private List<tingchechang> list;

   public tingchechangAdapter(List<tingchechang>  list) {
     this.list = list;
  }

//    public tingchechangAdapter(List<tingchechang> list){
//        //this.list =list;
//    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
       View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_rv_main_tingchechang,parent,false);
       ViewHolder viewHolder=new ViewHolder(view);


        return viewHolder;
    }

    @Override
    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
tingchechang tingchechang=list.get(position);

    }

    @Override
    public int getItemCount() {
        return list.size();
    }

    static class ViewHolder extends RecyclerView.ViewHolder {
      //  private final Object Button;
        TextView tvTitle,tvKongwei,tvmoney,tvjvli,tvaddress;
        Button button;
        ImageView imageView;

        public ViewHolder(@NonNull View itemView) {
            super(itemView);
             tvTitle = itemView.findViewById(R.id.txt_item_title);
             tvKongwei = itemView.findViewById(R.id.txt_item_kongwei);
             tvmoney = itemView.findViewById(R.id.txt_item_money);
             tvjvli = itemView.findViewById(R.id.txt_item_jvli);
             tvaddress = itemView.findViewById(R.id.txt_item_address);
            button = itemView.findViewById(R.id.btn_item_more);
            imageView = itemView.findViewById(R.id.img_item_tingchechang);


        }
    }
}
